<?php

if ($this->entity->gbid != 0) {
    $gb2 = $this->app->getEdo()->fetch($this->entity->gbid, 'ent_guestbook');

    print "<form class=\"guestbook_write\" name=\"guestbook_write\" method=\"post\" action=\"/guestbook/post\">";
    
    print Lead_Markup_Xhtml_Form::textInput('poster', 'poster', null, null, $gb2->poster);
    
    
    if($gb2->askemail) {
    	print Lead_Markup_Xhtml_Form::textInput('email', 'email', null, null, $gb2->email);
	}
	
	if($gb2->askwww) {
    	print Lead_Markup_Xhtml_Form::textInput('www', 'www', null, null, $gb2->www);
	}
	
	print Lead_Markup_Xhtml_Form::textArea('message', 'message', null, null, $gb2->message);
	
	print "<div class=\"buttons\">";
	
	print Lead_Markup_Xhtml_Form::button('submiter', 'submiter', null, $gb2->submitbutton, 'submit');
	print Lead_Markup_Xhtml_Form::button('resetter', 'resetter', null, $gb2->clearbutton, 'reset');
	
	print "</div>
	</form>";
}